package org.blame.cozebyspring.controller;


import org.blame.cozebyspring.service.CozeService;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/ai")
public class CozeController {

    private final CozeService cozeClient;

    public CozeController(CozeService cozeClient) {
        this.cozeClient = cozeClient;
    }

    //  问答机器人
    @GetMapping("/qa")
    public String askQuestion(@RequestParam("q") String q) {
        return cozeClient.askQuestion(q);
    }

    //  代码助手
    @GetMapping("/code")
    public String askCode(@RequestParam("q") String q) {
        return cozeClient.askCodeHelper(q);
    }

//    // 翻译助手（App）
//    @GetMapping("/translate")
//    public String translate(@RequestParam("tx") String text, @RequestParam("lg") String language) {
//        return cozeClient.translate(text, language);
//    }
}

